/*
 * @Description:
 * @Version: 1.0
 * @Autor: haozhuang
 * @Date: 2020-04-28 14:34:17
 * @LastEditors: haozhuang
 * @LastEditTime: 2020-05-07 17:34:44
 */
import Mock from 'mockjs'

const data = Mock.mock({
  'data|30': [
    {
      id: '@id',
      title: '@csentence(4,6)',
      icon: Mock.Random.image()
    }
  ]
})

export default [
  {
    url: '/vue-admin-template/home/add',
    type: 'post',
    response: config => {
      return {
        code: 20000,
        data: '添加成功'
      }
    }
  },
  {
    url: '/vue-admin-template/home/delete',
    type: 'post',
    response: config => {
      return {
        code: 20000,
        data: '删除成功'
      }
    }
  },
  {
    url: '/vue-admin-template/home/edit',
    type: 'post',
    response: config => {
      return {
        code: 20000,
        data: '修改成功'
      }
    }
  },
  {
    url: '/vue-admin-template/home/list',
    type: 'get',
    response: config => {
      const items = data.data
      return {
        code: 20000,
        data: {
          total: items.length,
          data: items
        }
      }
    }
  }

]
